function clamp(val, mmin, mmax)
	if val < mmin then return mmin elseif val > mmax then return mmax else return val end
end
function round(num, idp)
	local mult = 10^(idp or 0)
	return math.floor(num * mult + 0.5) / mult
end

inRange = function(x, minimum, maximum)
	if (minimum <= x) and (x <= maximum) then return true else return false end
end